package com.example.flowable.model;

import lombok.Data;
import org.flowable.engine.history.HistoricProcessInstance;

import java.util.Date;

@Data
public class HistoricProcessInstanceDTO {
    String id;
    String deploymentId;
    String description;
    String name;
    String tenantId;
    String businessKey;
    String callbackId;
    String callbackType;
    String processDefinitionId;
    String processDefinitionKey;
    String processDefinitionName;
    String processDefinitionVersion;
    String superProcessInstanceId;
    Date startTime;
    String startUserId;

    public HistoricProcessInstanceDTO(HistoricProcessInstance pi) {
        this.id = pi.getId();
        this.deploymentId = pi.getDeploymentId();
        this.description = pi.getDescription();
        this.name = pi.getName();
        this.tenantId = pi.getTenantId();
        this.businessKey = pi.getBusinessKey();
        this.callbackId = pi.getCallbackId();
        this.callbackType = pi.getCallbackType();
        this.processDefinitionId = pi.getProcessDefinitionId();
        this.processDefinitionKey = pi.getProcessDefinitionKey();
        this.processDefinitionName = pi.getProcessDefinitionName();
        this.processDefinitionVersion = pi.getProcessDefinitionId();
        this.superProcessInstanceId = pi.getSuperProcessInstanceId();
        this.startTime = pi.getStartTime();
        this.startUserId = pi.getStartUserId();
    }
}
